<script setup>
    import { useRouter,useRoute } from 'vue-router'
    import { useOrderStore } from "@/stores/order.js";

    const router = useRouter()
    const route = useRoute()
    const order = useOrderStore()

    const clickAdd = (item)=>{
        if (route.query.address) {
            router.push({
                path:'/orderCV',
                query:{
                    newId:item,
                    address:route.query.address,
                    shopName:route.query.shopName
                }
            })
        }
    }
</script>

<template>
  <div class="card" v-for="item,index in order.orderList" :key="index" @click="clickAdd(index)">
        <div class="info">
            <div class="name">{{ item.contact }}</div>
            <div class="tel">{{ item.phone }}</div>
        </div>
        <div class="address_text">{{ item.city }} {{ item.region }}{{ item.house }}</div>
    </div>
    <!-- <div class="card">
        <div class="info">
            <div class="name">小慕</div>
            <div class="tel">186111</div>
        </div>
        <div class="address_text">北京 海淀区</div>
    </div> -->
</template>

<style lang="scss" scoped>
@import '@/style/viriables.scss';
.card {
    margin: .18rem;
    padding: .18rem;
    background-color: $bgColor;
    border-radius: .04rem;
    font-size: .14rem;

    .info {
        display: flex;
        justify-content: space-between;
        margin-bottom: .08rem;
        color: $light-fontColor;

        div {
            flex: 1;
        }
    }
}
</style>